package com.mumulx.check.api.service;

import com.mumulx.check.redis.entity.PartTestBoxed;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/*
 *  Created by IntelliJ IDEA.
 *  User: 木木
 *  Date: 2020/10/31
 *  Time: 22:50
 *
 * 用于服务降级
 */
//降级
@Component
public class RemoteServiceFeignFallbackFactory implements FallbackFactory {


    @Override
    public RemoteFeignService create(Throwable throwable) {
        // 谁失败了就返回谁
        return new RemoteFeignService() {

            @Override
            public int test(int id) {
                return -2;
            }

            @Override
            public int executechecker(PartTestBoxed partTestBoxed) {
                return -2;
            }

        };
    }
}
